package com.yungu.swift.admin.base;

import com.yungu.swift.admin.base.license.VerifyLicense;
import com.yungu.swift.admin.config.ApplicationConfig;

/**
 * @author : cuixiuyin
 * @date : 2019/9/12
 */
public class LicenseCheck {

    private static final String LICENSE_PATH = "/";

    public void init() {
        boolean license = ApplicationConfig.SERVER_CONFIG.getSafety().getLicense();
        if (!license) {
            return;
        }
        // 项目唯一识别码，对应生成配置文件的subject
        VerifyLicense vlicense = new VerifyLicense("yungu");
        vlicense.install(LICENSE_PATH);
        if (!vlicense.vertify()) {
            Runtime.getRuntime().halt(1);
        }
    }

}
